#include <iostream>
using namespace std;

struct Point {
public:
    void setx(int x) {    _x = x;    }
    void sety(int y) {    _y = y;    }

    int _x;
    int _y;
};

struct Point3D 
: Point   //class默认继承方式是private继承
{
public:
    void setz(int z) {    _z = z;    }
    void print() const {
        cout << "(" << _x
             << "," << _y
             << "," << _z
             << ")" << endl;
    }
private:
    int _z;
};

int main() {
    Point3D pt;
    pt.setx(1);
    pt.sety(2);
    pt.setz(3);
    pt.print();
    return 0;
}
